import { Statics } from './statics'

export default function staticsEventFun(data) {
  const staticsEventMap = data
  // 当前对象可扩展全局公用业务属性
  const staticsEventObj = {}

  return (eventId, eventAttr) => {
    Object.assign(staticsEventObj, {
      ...staticsEventMap[eventId],
      // 公用自定义属性可在这边加
      eventAttr: {
        ...eventAttr,
      },
    })
    Statics.onEvent(staticsEventObj)
  }
}